package main

import (
	"fmt"
)

func main() {
	//sc := bufio.NewScanner(os.Stdin)
	//sc.Scan()
	//N, _ := strconv.Atoi(sc.Text())
	//getMoney(N)
	var n int

	fmt.Scanf("%d", &n)
	getMoney(n)
}

func getMoney(n int) {
	money := 1
	stage := 1
	times := 0
	for i := 2; i <= n; i++ {
		if times < stage {
			times++
			money++
		} else {
			money--
			stage++
			times = 0
		}
	}
	fmt.Println(money)
}